package com.jijuxie.house.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jijuxie.house.domain.HouseAppointment;
import org.springframework.transaction.annotation.Transactional;

public interface IHouseAppointmentService extends IService<HouseAppointment> {

    void addAppointment(HouseAppointment appointment);

    void cancelAppointment(Long appointmentId);

    Page<HouseAppointment> selectAppointmentPage(Page<HouseAppointment> page, Long userId);

    /**
     * 经纪人确认预约
     */
    void confirmAppointment(Long appointmentId);

    /**
     * 获取经纪人的预约列表
     */
    Page<HouseAppointment> selectAgentAppointmentPage(Page<HouseAppointment> page, Long agentId);

    /**
     * 创建预约
     */
    @Transactional(rollbackFor = Exception.class)
    void makeAppointment(HouseAppointment appointment);
}
